<?php

namespace common\models\cms;

use common\models\BaseModel;

class ArticleModel extends BaseModel {

    public $aId;
    public $tag;
    public $content;
    public $dirId;
    public $createdBy;
    public $createdTime;
    public $modifiedBy;
    public $modifiedTime;
    public $status;
    public $pv;
    public $title;
    public $dir;
    public $shareNum;
    public $imageUrl;
    public $fileUrl;
    public $fileName;
    public $sort;
    
	public function __construct($config = array()) {
        parent::__construct($config);
	}    
    
    public function rules () {
        return [
            [['title'], 'required', 'on' => 'save'],
            [['title'], 'string', 'max' => 50, 'on' => 'save'],
            [['tag'], 'string', 'max' => 32, 'on' => 'save'],
            [['aId','dirId', 'status', 'sort'], 'integer', 'on' => 'save'],
            [['content', 'title', 'tag', 'dir','imageUrl', 'fileUrl', 'status', 'fileName'], 'safe', 'on' => 'save'],
        ];
    }
    
    public function attributeLabels(){
        return [
            "content"=>"文章内容",
            "title"=>"标题",
            "tag"=>"tag关键字",
            "dir"=>"分类",
            "imageUrl"=>"图片链接",
            "fileUrl"=>"附件链接",
            "fileName" => "附件名称"
        ];
    }
    
}